#ifndef OBSTACLE_H
#define OBSTACLE_H

#include "gameobject.h"

class Obstacle : public GameObject
{
public:
    Obstacle(int speed, int lane, int type, QGraphicsItem *parent = nullptr);
    void update() override;
    int type() const override { return ObstacleType; }

    void setSpeed(int speed) { this->speed = speed; }
    int getLane() const { return lane; }

private:
    int speed;
    int lane; // 0: 上, 1: 中, 2: 下
    int obstacleType; // 0: 普通, 1: 高障碍, 2: 移动障碍
    int laneWidth;
    int moveDirection; // 用于移动障碍物

    void setupPixmap();
};

#endif // OBSTACLE_H
